#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int factor(int x)
{
	if (x == 0)
	{
		return 1;
	}
	int ret = 1;
	int i = 1;
	for (i = 1;i <= x;i++)
	{
		ret *= i;
	}
	return ret;
}
int factor2(int x)
{
	int n = 2*x + 1;
	int i = 1;
	int ret = 1;
	for (i = 1;i <= n;i += 2)
	{
		ret *= i;
	}
	return ret;
}
int main()
{
	double pi = 0;
	double term = 0;
	double cmp = 0;
	scanf("%lf", &cmp);
	int i = 0;
	for (i = 0;;i++)
	{
		term = (double)(factor(i)*1.0 / factor2(i)) ;
		pi += term;
		if (term < cmp)
		{
			break;
		}
	}
	printf("%f", pi*2);
	return 0;
}